<%@ page language="java" pageEncoding="UTF-8"%>
<link type="text/css" rel="stylesheet" href="Styles/SyntaxHighlighter.css"></link>
<link href="css/s.css" rel="stylesheet" type="text/css" />

	<SCRIPT language="javascript" src="js/http.js"></SCRIPT>
	<SCRIPT language="javascript" src="js/code.js"></SCRIPT>
	<table width="100%" align="center">
		<tr>
			<td>
				<table width="100%">
					<tr>
						<td style="font-size: 16px">
						<%
							if(request.getAttribute("flag").equals("0"))
								out.println("最新版本-"+codedate.substring(0,4)+"年"+codedate.substring(4,6)+"月");
							else out.println("最新版本-"+language);
						%>
						</td>
					</tr>
				</table>
			</td>
		</tr>
		<tr>
			<td height="15">&nbsp;</td>
		</tr>
		<tr>
			<td>
				<%
					if(codes.size() > 0 ){
						for( i = 0; i < codes.size(); i++){
							code = (Code)codes.get(i);
							String content = "content" + i;
				%>
					<table width="100%" align="center">
						<tr width="100%">
							<td colspan="2"  style="font-size: 12px">
								<b>标题：</b><%=code.getTitle()%>
								&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
								<b>语言：</b><%=code.getLanguage()%>
								&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
								<b>时间：</b>
								<%=code.getPublishTime().substring(5,7)%>月<%=code.getPublishTime().substring(8,10)%>日
								<%=code.getPublishTime().substring(11,13) %>时<%=code.getPublishTime().substring(14,16)%>分<%=code.getPublishTime().substring(17,19)%>秒
							</td>
							<td  colspan="2" align="center">
								<input type="button" class="signinbtn1" onclick="location.href='../servlet/ShareCode?codeid=<%=code.getId()%>&userid=<%=code.getUserid()%>'" value="分享">
						        <input type="button" class="signinbtn1" onclick="location.href='../servlet/ShowItems?codeid=<%=code.getId()%>&userid=<%=code.getUserid()%>'" value="历史版本">
							</td>
							
						</tr>
						<tr>
							<td><hr width="100%" align="left"/></td>
						</tr>
						<tr>
							<td height="10" colspan="2">更新说明:&nbsp;&nbsp;&nbsp;<%=code.getCaption()%></td>
						</tr>
						<tr>
							<td colspan="2">
								<textarea name=<%=content%> class= <%=code.getLanguage()%> cols="50" rows="20" readonly><%=code.getContent()%>
								</textarea>
								<script class="javascript" src="Scripts/shCore.js"></script>
								<script class="javascript" src="Scripts/shBrushCSharp.js"></script>
								<script class="javascript" src="Scripts/shBrushPhp.js"></script>
								<script class="javascript" src="Scripts/shBrushJScript.js"></script>
								<script class="javascript" src="Scripts/shBrushJava.js"></script>
								<script class="javascript" src="Scripts/shBrushVb.js"></script>
								<script class="javascript" src="Scripts/shBrushSql.js"></script>
								<script class="javascript" src="Scripts/shBrushXml.js"></script>
								<script class="javascript" src="Scripts/shBrushDelphi.js"></script>
								<script class="javascript" src="Scripts/shBrushPython.js"></script>
								<script class="javascript" src="Scripts/shBrushRuby.js"></script>
								<script class="javascript" src="Scripts/shBrushCss.js"></script>
								<script class="javascript" src="Scripts/shBrushCpp.js"></script>&nbsp;
								<script class="javascript">
								dp.SyntaxHighlighter.HighlightAll('<%=content%>');
								</script>
							</td>
						</tr>
						<tr>
							<td style="font-size: 12px;" align="right">
							    <A href="javascript:openRemarkSection(<%=code.getId()%>,<%=code.getUserid()%>)">评论（<span id="remarkNum<%=code.getId()%>"><%=code.getRemarkNum()%></span>）</A>
							</td>
						</tr>
						<tr>
							<td height="20" colspan="2">&nbsp;</td>
						</tr>
					</table>
					<table>
						<tr>
							<td>
								<div id="remarkSection<%=code.getId()%>" style="display: none;">评论区</div>
							</td>
						</tr>
					</table>
					<hr width="100%" align="left" style="border-top: 2px dashed; border-bottom: 2px dashed; height: 1px ; border-color:gray">
					<br/>
					<br/>
				<%
						}
					}
					else
						out.print("<b>此存档中没有项</b><br><br>");
				%>
			</td>
		</tr>
	</table>